package person.locke.regexandgame.game.zombie;

import person.locke.regexandgame.game.ability.Attackable;
import person.locke.regexandgame.game.ability.Flyable;
import person.locke.regexandgame.game.plant.Plant;

/**
 * Created by Locker on 2018/7/4.
 */
public class FlyZombie extends Zombie implements Flyable,Attackable{

    private int attack;

    public FlyZombie() {
    }

    public FlyZombie(String name, int hp, int attack) {
        super(name, hp);
        this.attack = attack;
    }


    public void attack(Object o) {

        if(o instanceof Plant)
            System.out.println("I'm a "+this.getName()+".\n"+"I hurt "+((Plant)o).getName()+" "+attack+" hq!");
        else
            System.out.println("I can not hurt this object. "+o);

    }

    public void fly() {
        System.out.println("I'm a "+this.getName()+".\n"+"I can fly!");
    }
}
